//
//  CityHeardView.m
//  Travel assistant
//
//  Created by 杨帆 on 16/3/2.
//  Copyright © 2016年 旅游助手. All rights reserved.
//

#import "CityHeardView.h"

@implementation CityHeardView

-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        self.backgroundColor = [UIColor whiteColor];
        [self addViews];
    }
    
    return self;
}

-(void)addViews{
    
    self.search = [[UISearchController alloc]initWithSearchResultsController:nil];
    
    self.search.searchBar.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height*0.45);
    
    [self addSubview:self.search.searchBar];
    
    
    
    NSArray *itemArray = @[@"境内",@"境外"];
    
    self.segment = [[UISegmentedControl alloc]initWithItems:itemArray];
    
    self.segment.frame = CGRectMake(0, self.frame.size.height*0.55, self.frame.size.width, self.frame.size.height*0.45);
    
    self.segment.apportionsSegmentWidthsByContent = YES;
    
    self.segment.tintColor = [UIColor redColor];
    
    self.segment.selectedSegmentIndex = 0;
    
    [self addSubview:self.segment];
    
    
    
    
}


@end
